#pragma once

#ifdef PF_PLATFORM_PC

#include "PfInputKeyboard.PC.h"

namespace pf
{
	class PlatformPC : public Platform
	{
		// Master
		void					Initialise(InitParamsHandle hInitParams);
		void					Shutdown();
		bool					Present();

		void*					GetPlatformWindowHandle() const;
		DisplayConfigHandle		GetDisplayConfig();

		InputKeyboardHandle		GetKeyboard();

	private:

		HWND					m_hWnd;
		bool					m_quitRequested;
		DisplayConfig			m_displayConfig;
		DisplayConfig*			m_pSelectedDisplayConfig;
		InputKeyboardPC			m_keyboard;

		void					CreateDisplay(InitParamsHandle hInitParams);
		void					SelectDisplayConfig(IDisplayConfigSelectorHandle hDisplayConfigSelector);

		LRESULT					WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
		static LRESULT CALLBACK	StaticWndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
	};

	typedef cr::Handle<PlatformPC> PlatformPCHandle;

	inline void* PlatformPC::GetPlatformWindowHandle() const
	{
		return m_hWnd;
	}

	inline DisplayConfigHandle PlatformPC::GetDisplayConfig()
	{
		return m_pSelectedDisplayConfig;
	}
}

#endif